-
Notifications
You must be signed in to change notification settings - Fork 38.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
e2e test for storage class diskformat verification for vsphere cloud provider #41239
e2e test for storage class diskformat verification for vsphere cloud provider #41239
Conversation
Hi @divyenpatel. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
@k8s-bot ok to test |
@jeffvance can you also review? |
@divyenpatel probably need to add |
if err != nil { | ||
return nil, err | ||
} | ||
vs := VSphere{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not vs := &VSphere{ ...
?
Then remove &
below? There may be a good reason for not doing this but it is a fairly common pattern.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed. followed common pattern.
test/e2e/vsphere_utils.go
Outdated
@@ -178,3 +179,89 @@ func verifyContentOfVSpherePV(client clientset.Interface, pvc *v1.PersistentVolu | |||
runInPodWithVolume(client, pvc.Namespace, pvc.Name, "grep '"+expectedContent+"' /mnt/test/data") | |||
framework.Logf("Sucessfully verified content of the volume") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Successfully..."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
test/e2e/vsphere_utils.go
Outdated
scAnnotation := make(map[string]string) | ||
scAnnotation["volume.beta.kubernetes.io/storage-class"] = storageclass.Name | ||
|
||
claim := v1.PersistentVolumeClaim{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same question about why not using:
claim := &v1.PersistentVolumeClaim{
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed. followed common pattern.
11. Delete PVC, PV and Storage Class | ||
*/ | ||
|
||
var _ = framework.KubeDescribe("Volume Disk Format", func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider adding [Volume]
and [vsphere]
tags
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done.
framework.KubeDescribe("Volume Disk Format [Feature:Volumes] [vsphere]", func() {
Also added vsphere tag in vsphere_volume_placement.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
grep -R "\[Feature:Volumes\]" test | wc -l
3
grep -R "\[Volume\]" test |wc -l
82
so, for now, [Volume] (singular) is far more common.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, will use Volume then
client.CoreV1().PersistentVolumeClaims(namespace).Delete(pvclaimSpec.Name, nil) | ||
}() | ||
|
||
By("Waiting for calim to be in bould phase") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"claim", "bound"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed. Will turn on spell checker my IDE next time.
PV is required to be attached to the Node. so that using govmomi API we can grab Disk's Backing Info | ||
to check EagerlyScrub and ThinProvisioned property | ||
*/ | ||
By("Creating POD to attach PV to the node") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: "POD" is not an acronym like "PV" is. Usually lowercase "pod" is displayed in messages.
By("Creating POD to attach PV to the node") | ||
// Create POD to attach Volume to Node | ||
podSpec := getVSpherePodSpecWithClaim(pvclaim.Name, nodeKeyValueLabel, "while true ; do sleep 2 ; done") | ||
pod, err := client.CoreV1().Pods(namespace).Create(podSpec) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
test for err missing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added assert check for all err
f := find.NewFinder(govMoMiClient.Client, true) | ||
ctx, _ := context.WithCancel(context.Background()) | ||
vm, err := f.VirtualMachine(ctx, os.Getenv("VSPHERE_WORKING_DIR")+nodeName) | ||
vmDevices, err := vm.Device(ctx) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is an err
check needed here?
11. Delete PVC, PV and Storage Class | ||
*/ | ||
|
||
var _ = framework.KubeDescribe("Volume Disk Format", func() { | ||
var _ = framework.KubeDescribe("Volume Disk Format [Feature:Volume] [vsphere]", func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't fully understand the difference between "[Feature:xyz]
" vs "[xyz]
". This doc describes "Feature:" as:
"If a test has non-default requirements to run or targets some non-core functionality, and thus should not be run as part of the standard suite. "
So, my choice would be to simply use [Volume]
as the tag, as done in ~82 other tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought it would be easier to filter vsphere related tests with adding [vsphere] tag.
but if this is not the convention, let’s remove this.
@@ -109,17 +109,21 @@ func invokeTest(client clientset.Interface, namespace string, nodeName string, n | |||
By("Creating Storage Class With DiskFormat") | |||
storageClassSpec := getVSphereStorageClassSpec("thinsc", scParameters) | |||
storageclass, err := client.StorageV1beta1().StorageClasses().Create(storageClassSpec) | |||
Expect(err).NotTo(HaveOccurred()) | |||
|
|||
defer client.StorageV1beta1().StorageClasses().Delete(storageclass.Name, nil) | |||
Expect(err).NotTo(HaveOccurred()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
redundant with L112. I may have given a poor review comment previously?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed redundant check. Thanks for detailed review.
test/e2e/vsphere_volume_placement.go
Outdated
@@ -28,7 +28,7 @@ import ( | |||
"k8s.io/kubernetes/test/e2e/framework" | |||
) | |||
|
|||
var _ = framework.KubeDescribe("Volume Placement [Feature:Volume]", func() { | |||
var _ = framework.KubeDescribe("Volume Placement [Feature:Volume] [vsphere]", func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same "Feature:" comment as above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
eeadec8
to
6ce2dfb
Compare
/approve |
1 similar comment
/approve |
@jeffvance addressed all review comments. |
11. Delete PVC, PV and Storage Class | ||
*/ | ||
|
||
var _ = framework.KubeDescribe("Volume Disk Format [Feature:Volume]", func() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's been some back and forth here. IMO, this line should be:
var _ = framework.KubeDescribe("Volume Disk Format [Volumes]", func() {...
In a previous comment I've shown about 25x more occurences in test/ of my suggestion vs what you have above. But I may be misunderstanding how [Feature:xyz]` works, or vsphere may have special needs here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed. There is no special need in vpshere. Just followed same pattern as in volumes.go
@divyenpatel One comment above. Overall, looks good to me; however I am not an assignee so I cannot add LGTM. |
adding govmomi dep to test/e2e/BUILD adding golang.org/x/net/context to e2e deps addressed review comments addressed 2nd round of review comments addressed review comments regarding KubeDescribe tagging
6ce2dfb
to
cdb48fb
Compare
[APPROVALNOTIFIER] This PR is APPROVED The following people have approved this PR: divyenpatel, kerneltime, spxtr Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
@deads2k can you review and approve this change? |
@k8s-bot verify test this |
@jeffvance Jenkins verification passed. |
/lgtm |
Automatic merge from submit-queue (batch tested with PRs 37137, 41506, 41239, 41511, 37953) |
What this PR does / why we need it:
This PR adds a new e2e test for vsphere cloud provider.
Test is to verify diskformat specified in storage-class is being honored while volume creation.
Steps:
eagerzeroedthick
,zeroedthick
andthin
)VirtualDiskFlatVer2BackingInfo
-EagerlyScrub
andThinProvisioned
EagerlyScrub
andThinProvisioned
, verify if diskformat is correct.Which issue this PR fixes *
fixes #
Special notes for your reviewer:
Test is executed against v1.6.0-alpha.1
Test is failing on v1.4.8
Release Note
@kerneltime @BaluDontu @abrarshivani please review this PR